<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格测试</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/static/css/tableTest.css">
</head>
<body>
<h1>test table</h1>


<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script>
    $(document).ready(function(){
        $.getJSON('/api/info',function(result){

            var keys = [];

            if (result.length>0){
                var one = result[0];
                var key;
                for(key in one){
                    if(one.hasOwnProperty(key)){
                        keys.push(key);
                    }
                }
            }
            console.log("keys:"+keys);
            $.each(result,function(i,field){
                var str ='';
                for(var k =0;k<keys.length;k++){
                    str += field[keys[k]] + " ";
                }
               console.log(str);
            });
        });
    });

</script>
</body>
</html>